/*
 * Copyright (c) 2008-2009 Bill Whitacre http://rampancy.g0dsoft.com
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
*/

// this is to be included in common.h
#ifndef RAT_PHYSICS_DEFINES
#define RAT_PHYSICS_DEFINES

// use the dlmalloc prefix
#define USE_DL_PREFIX

#if defined(__linux__)
#	define RAT_PHYSICS_LINUX
#elif defined(WIN32)||defined(_WIN32)||defined(__WIN32)||defined(__WIN32__)||defined(Windows)
#	define RAT_PHYSICS_WINDOWS
#	ifdef _MSC_VER
#		define RAT_PHYSICS_MSVC
#	endif
#elif defined(__MACOSX__)
#	define RAT_PHYSICS_MACOSX
#endif

#if (!defined(RAT_PHYSICS_MSVC))&&(defined(__GNUC__)||defined(__GNU_C__))
#	define RAT_PHYSICS_GCC
#endif

#if defined(RAT_PHYSICS_LINUX)
#	include <sys/io.h>
#	include <sys/types.h>
#	include <GL/gl.h>
#elif defined(RAT_PHYSICS_WINDOWS)
#	include <windows.h>
#	include <gl\GL.h>
#elif defined(RAT_PHYSICS_MACOSX)
#	include <sys/types.h>
#	include <OpenGL/gl.h>
#endif

#include <math.h>

#ifdef RAT_PHYSICS_DOUBLE_PRECISION
#	ifndef rat_real
		typedef double rat_real;
#	endif
#else
#	ifndef rat_real
		typedef float rat_real;
#		define acos(a)		acosf(a)
#		define asin(a)		asinf(a)
#		define atan(a)		atanf(a)
#		define atan2(a,b)	atan2(a,b)
#		define sin(a)		sinf(a)
#		define cos(a)		cosf(a)
#		define tan(a)		tanf(a)
#		define sqrt(a)		sqrtf(a)
#		define log(a)		logf(a)
#	endif
#endif

#ifndef MATH_PI
#	ifdef M_PI
#		define MATH_PI M_PI
#	else
#		define MATH_PI 3.14159265358979323846
#	endif
#endif

#endif
